package LoginPackage;


import static org.openqa.selenium.support.ui.ExpectedConditions.visibilityOfElementLocated;





import org.openqa.selenium.By;
import org.testng.annotations.*;

import PagePackage.MyPageFactory;
import PagePackage.internalPageClass;
import PagePackage.leaguePage;
import PagePackage.loginPageClass;


public class EditLeagueClass extends TestBaseClass {
	

	@Test (priority=0)
	  public void  SAEditsLeagueMaleBasketball() {
		  goToMainPage(); 
		  checkPage();
		  MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/leagues");
		  MyPageFactory.getPage(driver, leaguePage.class).findLeague("Male Basketball League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Male Basketball League Edit']")
		  .chooseLeagueSport("Football")
		  .addLeagueName("Selenium Male Basketball League Edit")
		  .chooseGender("coed")
		  .saveLeague()
		  .findLeague("Selenium Male Basketball League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Selenium Male Basketball League Edit']");
		  
		  
		  
		  wait.until(visibilityOfElementLocated(By.name("sport")));
		  
		  driver.findElement(By.xpath("//*[text()='Football']")).getAttribute("selected");
		 
		  driver.findElement(By.xpath("//*[text()='coed']")).getAttribute("selected");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
			 MyPageFactory.getPage(driver, internalPageClass.class).logout();
	}
	
	
	@Test (priority=1)
	  public void SAEditsLeagueFemaleBasketball() {
		  goToMainPage(); 
		  checkPage();
		  MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/leagues");
		  MyPageFactory.getPage(driver, leaguePage.class).findLeague("Female Basketball League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Female Basketball League Edit']")
		  
		  .chooseLeagueSport("Football")
		  .addLeagueName("Selenium Female Basketball League Edit")
		  .chooseGender("coed")
		  .saveLeague();
		  
		  MyPageFactory.getPage(driver, leaguePage.class).findLeague("Selenium Female Basketball League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Selenium Female Basketball League Edit']");
		  
		  
		  
		  
wait.until(visibilityOfElementLocated(By.name("sport")));
driver.findElement(By.xpath("//*[text()='Football']")).getAttribute("selected");

driver.findElement(By.xpath("//*[text()='coed']")).getAttribute("selected");
driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
MyPageFactory.getPage(driver, internalPageClass.class).logout();
	}
	
	@Test (priority=2)
	  public void SAEditsLeagueCoedBasketball() {
		  goToMainPage(); 
		  checkPage();
		  MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/leagues");
		  MyPageFactory.getPage(driver, leaguePage.class).findLeague("Coed Basketball League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Coed Basketball League Edit']")
		 
		  .chooseLeagueSport("Football")
		  .addLeagueName("Selenium Coed Basketball League Edit")
		  .chooseGender("coed")
		  .saveLeague()
		  .findLeague("Selenium Coed Basketball League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Selenium Coed Basketball League Edit']");
		  
		  
		  wait.until(visibilityOfElementLocated(By.name("sport")));
		  driver.findElement(By.xpath("//*[text()='Football']")).getAttribute("selected");

		  driver.findElement(By.xpath("//*[text()='coed']")).getAttribute("selected");
		  
		  driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
MyPageFactory.getPage(driver, internalPageClass.class).logout();
	} 
	
	
	@Test (priority=3)
	  public void SAEditsLeagueMaleFootball() {
		  goToMainPage(); 
		  checkPage();
		  MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/leagues");
		  MyPageFactory.getPage(driver, leaguePage.class).findLeague("Male Football League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Male Football League Edit']")
		  
		  .chooseLeagueSport("Football")
		  .addLeagueName("Selenium Male Football League Edit")
		  .chooseGender("coed")
		  .saveLeague()
		  .findLeague("Selenium Male Football League Edit")
		 .scrollAndClickLeague( 0, 0, "//*[text()='Selenium Male Football League Edit']");
		  
		  wait.until(visibilityOfElementLocated(By.name("sport")));
		  driver.findElement(By.xpath("//*[text()='Football']")).getAttribute("selected");

		  driver.findElement(By.xpath("//*[text()='coed']")).getAttribute("selected");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
MyPageFactory.getPage(driver, internalPageClass.class).logout();
		  
		  
	}
	
	@Test (priority=4)
	  public void SAEditsLeagueFemaleFootball() {
		  goToMainPage(); 
		  checkPage();
		  MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/leagues");
		  MyPageFactory.getPage(driver, leaguePage.class).findLeague("Female Football League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Female Football League Edit']")
		   .chooseLeagueSport("Football")
		  .addLeagueName("Selenium Female Football League Edit")
		  .chooseGender("coed")
		  .saveLeague()
          .findLeague("Selenium Female Football League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Selenium Female Football League Edit']");
		  
		  wait.until(visibilityOfElementLocated(By.name("sport")));
		  driver.findElement(By.xpath("//*[text()='Football']")).getAttribute("selected");

		  driver.findElement(By.xpath("//*[text()='coed']")).getAttribute("selected");
		  
		  driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
MyPageFactory.getPage(driver, internalPageClass.class).logout();
		  
	}
	
	
	@Test (priority=5)
	  public void SAEditsLeagueCoedFootball() {
		  goToMainPage(); 
		  checkPage();
		  MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/leagues");
		  MyPageFactory.getPage(driver, leaguePage.class).findLeague("Coed Football League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Coed Football League Edit']")
		  
		  .chooseLeagueSport("Football")
		  .addLeagueName("Selenium Coed Football League Edit")
		  .chooseGender("coed")
		  .saveLeague()
		  .findLeague("Selenium Coed Football League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Selenium Coed Football League Edit']");
		  
		  wait.until(visibilityOfElementLocated(By.name("sport")));
		  driver.findElement(By.xpath("//*[text()='Football']")).getAttribute("selected");
		  driver.findElement(By.xpath("//*[text()='coed']")).getAttribute("selected");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
MyPageFactory.getPage(driver, internalPageClass.class).logout();
		  
	} 
	
	@Test (priority=6)
	  public void SAEditsLeagueMaleLacrosse() {
		  goToMainPage(); 
		  checkPage();
		  MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/leagues");
		  MyPageFactory.getPage(driver, leaguePage.class).findLeague("Male Lacrosse League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Male Lacrosse League Edit']")
		  
		  .chooseLeagueSport("Football")
		  .addLeagueName("Selenium Male Lacrosse League Edit")
		  .chooseGender("coed")
		  .saveLeague()
		  .findLeague("Selenium Male Lacrosse League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Selenium Male Lacrosse League Edit']");
		  
		  wait.until(visibilityOfElementLocated(By.name("sport")));
		  driver.findElement(By.xpath("//*[text()='Football']")).getAttribute("selected");
		  driver.findElement(By.xpath("//*[text()='coed']")).getAttribute("selected");
		  
		  driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
MyPageFactory.getPage(driver, internalPageClass.class).logout();
		  
	} 
	
	@Test (priority=7)
	  public void SAEditsLeagueFemaleLacrosse() {
		  goToMainPage(); 
		  checkPage();
		  MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/leagues");
		  MyPageFactory.getPage(driver, leaguePage.class).findLeague("Female Lacrosse League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Female Lacrosse League Edit']")
		  .chooseLeagueSport("Football")
		  .addLeagueName("Selenium Female Lacrosse League Edit")
		  .chooseGender("coed")
		  .saveLeague()
		  .findLeague("Selenium Female Lacrosse League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Selenium Female Lacrosse League Edit']");
		  wait.until(visibilityOfElementLocated(By.name("sport")));
		  driver.findElement(By.xpath("//*[text()='Football']")).getAttribute("selected");
		  driver.findElement(By.xpath("//*[text()='coed']")).getAttribute("selected");
		  
		  
		  driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
MyPageFactory.getPage(driver, internalPageClass.class).logout();
	} 
	
	
	
	@Test (priority=8)	
	  public void SAEditsLeagueCoedLacrosse() {
		  goToMainPage(); 
		  checkPage();
		  MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@victoria.com", "webmaster");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/leagues");
		  MyPageFactory.getPage(driver, leaguePage.class).findLeague("Coed Lacrosse League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Coed Lacrosse League Edit']")
		  .chooseLeagueSport("Football")
		  .addLeagueName("Selenium Coed Lacrosse League Edit")
		  .chooseGender("coed")
		  .saveLeague()
		  .findLeague("Selenium Coed Lacrosse League Edit")
		  .scrollAndClickLeague( 0, 0, "//*[text()='Selenium Coed Lacrosse League Edit']");
		  
		  wait.until(visibilityOfElementLocated(By.name("sport")));
		  driver.findElement(By.xpath("//*[text()='Football']")).getAttribute("selected");
		  driver.findElement(By.xpath("//*[text()='coed']")).getAttribute("selected");
		  driver.get("https://www-dev.krossover.com/intelligence-qa/teams");
MyPageFactory.getPage(driver, internalPageClass.class).logout();
	} 
	
	
	
	
	}
	
	
	

